package com.mida.app.knw.service.impl;

import com.mida.app.knw.service.KnwCommonWordsTreeService;
import com.mida.dms.knw.api.KnwCommonWordsTreeApi;
import com.mida.dms.knw.entity.KnwCommonWordsTree;
import com.mida.dms.knw.vo.CommonWordsTreeDto;
import com.mida.dms.knw.vo.CommonWordsTreeVo;
import com.mida.tool.common.result.ActionResult;
import com.mida.tool.common.result.BaseResult;
import com.mida.tool.common.result.ListResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@Slf4j
@Service
@Transactional
public class KnwCommonWordsTreeServiceImpl extends BaseResult implements KnwCommonWordsTreeService {
    @Autowired
    private KnwCommonWordsTreeApi knwCommonWordsTreeApi;

    @Override
    @Transactional
    public ActionResult addCommonWordsTree(CommonWordsTreeVo commonWordsTreeVo) {
        return knwCommonWordsTreeApi.addCommonWordsTree(commonWordsTreeVo);
    }

    @Override
    public ListResult<List<CommonWordsTreeVo>> selectCommonWordsTrees(@RequestBody CommonWordsTreeVo commonWordsTreeVo) {
        return knwCommonWordsTreeApi.selectCommonWordsTrees(commonWordsTreeVo);
    }



    @Override
    @Transactional
    public ActionResult deleteCommonWordsTree(CommonWordsTreeVo commonWordsTreeVo) {
        ActionResult actionResult = knwCommonWordsTreeApi.deleteCommonWordsTree(commonWordsTreeVo);
        return actionResult;
    }

    @Override
    @Transactional
    public ActionResult updateCommonWordsTree(CommonWordsTreeVo commonWordsTreeVo) {
        return knwCommonWordsTreeApi.updateCommonWordsTree(commonWordsTreeVo);
    }

    @Override
    @Transactional
    public ActionResult sortCommonWordsTree(List<KnwCommonWordsTree> commonWordsTreeSoids) {
        return  knwCommonWordsTreeApi.sortCommonWordsTree(commonWordsTreeSoids);
    }


    @Override
    public ActionResult shareCommonWordsTrees(CommonWordsTreeVo commonWordsTreeVo) {
        return knwCommonWordsTreeApi.shareCommonWordsTrees(commonWordsTreeVo);
    }


    @Override
    public Integer isDelete(CommonWordsTreeVo commonWordsTreeVo) {

        return knwCommonWordsTreeApi.isDelete(commonWordsTreeVo);
    }

}
